<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JavaScript</title>
</head>
<body>
    <ul id="list">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ul>
    <script>
        // event.targer始终获取被触发的元素节点
        window.onload = function(){
            var the_ul = document.getElementsByTagName('ul')[0]
            the_ul.onclick = function(e){
            alert(e.target.innerHTML)
            }
        }
    </script>
</body>
</html>